package cn.app.android.sichuanxiaoke.com.xiaokeapp.adapter;

import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

import com.bumptech.glide.Glide;

import cn.app.android.sichuanxiaoke.com.xiaokeapp.R;

/**
 * Created by Administrator on 2017/9/3.
 */

public class HomeGoodsShowNewsAdapter extends BaseAdapter {
    private Context context;
    private String[] data;

    public HomeGoodsShowNewsAdapter(Context context, String[] data) {
        this.context = context;
        this.data = data;
    }

    @Override
    public int getCount() {
        return data.length;
    }

    @Override
    public Object getItem(int position) {
        return position;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View view = LayoutInflater.from(context).inflate(R.layout.home_fragment_goods_show_item, parent, false);
        ImageView imageview= (ImageView) view.findViewById(R.id.itemIamge);
        Glide.with(context).load(data[position]).placeholder(R.mipmap.ic_launcher_round).into(imageview);
        return view;
    }
}
